package antoine.ear.generator;

import java.util.Random;

public class NoteGenerator {
			
	public static int generateNote(int octave){
		
		Random random = new Random();
		int note = random.nextInt(12);
		
		return (note+24+octave*12);
		
	}

	public static String getNoteName(int note){
		int i = note%12;
		switch (i){
			case 0 : return "C";
			case 1 : return "Cb";
			case 2 : return "D";
			case 3 : return "Eb";
			case 4 : return "E";
			case 5 : return "F";
			case 6 : return "Gb";
			case 7 : return "G";
			case 8 : return "Ab";
			case 9 : return "A";
			case 10: return "Bb";
			case 11: return "B";
		}
		return "error";
	}
}
